package net.jxvtc.blogv1.repository;


import net.jxvtc.blogv1.domain.Comment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.transaction.Transactional;

public interface CommentRepository extends CrudRepository<Comment,Integer> {
    @Transactional
    @Modifying
    //SQL  HQL
    @Query("UPDATE t_comment c SET c.author= ?1 WHERE  c.id = ?2")
    public int updateComment(String author,Integer id);




    Page<Comment> findCommentByAuthorIsLike(String author,Pageable pageable);


}